<?php
class Blog extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();
		
	}
	public function view()
	{
		$data = array();
		$matrix = 
		[
		  [0,0,0,0],
		  [0,0,0,0],
		  [0,0,0,0],
		  [0,0,0,0]
		];
		$start = $this->_init();
		foreach($start as $target)
		{
			$matrix[$target[0]][$target[1]] = 2;
		}
		$data['matrix'] = $matrix;
		$data['start'] = $start;
		$this->load->view('second_index',$data);
	}
	
	protected function _init()
	{
		$array = array();
		$x = rand(0,3);
		$y = rand(0,3);
		$array[] = [$x,$y];
		$x = rand(0,3);
		$y = rand(0,3);
		$array[] = [$x,$y];
		$x = rand(0,3);
		$y = rand(0,3);
		$array[] = [$x,$y];
		$x = rand(0,3);
		$y = rand(0,3);
		$array[] = [$x,$y];
		return $array;
	}
	

}